package SyncPool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPoolExeService {
	private static ExecutorService executorService;
	ThreadPoolExeService threadPoolExeService;
	
	public ThreadPoolExeService(){
		if(executorService==null)executorService=Executors.newFixedThreadPool(3);
	}
	
	
	public  ThreadPoolExeService  getInstance(){
		if(threadPoolExeService==null)threadPoolExeService=new ThreadPoolExeService();
 
		return threadPoolExeService;
	}
	
	@SuppressWarnings("unchecked")
	public static  void exece(CallBack obj){
		executorService.submit(obj);
	}
	
	
	
	
	
	

}
